package com.minglead.springboot.platform.sys.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.minglead.springboot.common.persistence.CrudDao;
import com.minglead.springboot.common.persistence.TreeDao;
import com.minglead.springboot.platform.sys.entity.Role;
import com.minglead.springboot.platform.sys.entity.RoleMenu;
import com.minglead.springboot.common.crud.annotation.MyBatisDao;

/**
 * 角色DAO接口
 */
@MyBatisDao
public interface RoleDao extends CrudDao<Role> {

	public Role getByName(Role role);
	
	public Role getByCode(Role role);

	/**
	 * 维护角色与菜单权限关系
	 * @param role
	 * @return
	 */
	public int deleteRoleMenu(Role role);

	public int insertRoleMenu(RoleMenu roleMenu);

	/*删除用户角色关系*/
	public int deleteUserRole(Role role);
	
	public List<Role> getRoleList();
	
	public List<Role> getRoleListByUserId(@Param("userId")String userId);
	

}
